/*
 *  This file is part of "SchoolChoice",
 *  a school registration system.
 *
 *  Copyright (C) 2009 Nicolas Decerf, Olivier Jacquemin.
 *
 *  "SchoolChoice" is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  "SchoolChoice" is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program: see the file COPYING.txt.  If not, see
 *  http://www.gnu.org/licenses/.
 */

/*global $ */

/*
 * The only global variable of the application,
 * which is used as a package (or namespace).
 */
var SchoolChoice = {};
SchoolChoice.WebAppClient = {};

/*
 * Code to execute when the DOM is ready.
 */
$(function() {
      // Shortcut notation.
      var WAC = SchoolChoice.WebAppClient;

      WAC.Logger.info("Test of Logger.info() method.");
      WAC.Logger.severe("Test of Logger.severe() method.");

      $("button").addClass("ui-state-default").hover(
		  function() { $(this).addClass('ui-state-hover'); }, 
		  function() { $(this).removeClass('ui-state-hover'); }
	  );

      WAC.Controller.load();

      $.get("init", function() {
          WAC.Logger.info("Init servlet loaded.");

          WAC.WebServiceProxy.initialize();
          WAC.Logger.info("Proxy to web services initialized.");
      });
});
